package com.spboot.controller;


import com.spboot.entity.Role;
import com.spboot.service.IRoleService;
import com.spboot.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author guocb
 * @since 2021-03-25
 */
@CrossOrigin //支持跨域
@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    IRoleService roleService;

    @RequestMapping("/list")
    public Result list() {
        return Result.ok(roleService.list());
    }
}
